package de.gwtprime.server.model;

import javax.persistence.Entity;
import javax.persistence.Table;

import de.gwtprime.util.Helper;


@Entity
@Table(name = "users")
public class User extends EntityBase{
	
	/**
	 * Unique id -> email-adress
	 */
	private String email;

	
	/**
	 * User needs to active his account first by verifing his email adress.
	 */
	private boolean active = false;
	
	private String activationHash = Helper.getRandomHash();
	
	/**
	 * Default constructor for JPA
	 */
	public User(){}
	
	/**
	 * Constructor
	 * @param email
	 */
	public User(String email){
		this.email = email;
	}
	
	
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}


	public boolean isActive() {
		return active;
	}


	public void setActive(boolean active) {
		this.active = active;
	}


	public String getActivationHash() {
		return activationHash;
	}


	public void setActivationHash(String activationHash) {
		this.activationHash = activationHash;
	}
	
	




}
